1. Field of the Invention
The present invention relates to an image coding apparatus for coding image data.
2. Description of the Related Art
In an image processing apparatus, such as a copier, image data to be processed is coded and compressed for efficient transfer of the image data. For higher processing speed of the whole image processing apparatus, a higher compression speed is desired. Thus, in view of balancing compression ratio and processing speed, an image coding apparatus shown in FIG. 3 is utilized, for example. The image coding apparatus is equivalent to that described in Japanese Patent Laid-Open Publication No. 2000-350215.
In the image coding apparatus shown in FIG. 3, pixels of interest are sequentially selected from image data input via an image input unit 1 in a predetermined scanning order, and a pixel value of each pixel of interest is predicted by a plurality of prediction units 2a, 2b, . . . , 2n. As shown in FIG. 4, each prediction unit 2 outputs, as a predicted pixel value, values of pixels in the vicinity of the pixel of interest, for example, values of a pixel (A) located to the left of the pixel of interest, a pixel (B) located above the pixel of interest, a pixel (C) locate to the left of the pixel (B) and a pixel (D) located to the right of the pixel (B). For each prediction unit 2, a run-length count unit 3 counts the number of times the prediction unit 2 successively outputs the predicted pixel value corresponding with the pixel value of the pixel of interest.
A selection unit 4 selects a longest run-length from the run-lengths counted by the run count unit 3. If the longest run-length is equal to 1 or greater, the selection unit 4 outputs information for identifying the prediction unit 2 having output the longest run-length (identification information). On the other hand, if the longest run-length is 0, the selection unit 4 outputs a prediction error (a difference between pixel values of the pixel A and pixel of interest in FIG. 4, for example) generated by a prediction error calculation unit 5. A coding unit 6 codes the identification information on the prediction unit 2 or the prediction error output from the selection unit 4 based on a code table and outputs the result.
Another conventional image coding apparatus is based on the periodicity of image data. To provide an LZ77-based data compression apparatus, the apparatus comprises a moving window for storing coded input data and a comparator for comparing a substring of an entry in the moving window with a data string obtained by coding the substring. The number of comparators is less than the size of the moving window, and a vicinity of 0, a vicinity of L (L being an input parameter) or a vicinity of 2L is used as an offset to the entry. (Japanese Patent Laid-Open Publication No. Hei11-168389)